﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcs.Web.Controls
{
    public partial class bidPlanResultCheck : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }
        }

        private void Bind()
        {
            if (Session["supplier_bidplan_order"] != null)
            {
                List<Maticsoft.Model.supplier_bidplan_order> l = Session["supplier_bidplan_order"] as List<Maticsoft.Model.supplier_bidplan_order>;

                if (l.Count > 0)
                {
                    string zbgs = "，共有" + l.Count + "家企业即：";

                    foreach (Maticsoft.Model.supplier_bidplan_order so in l)
                    {
                        zbgs += so.sname + "、";
                    }

                    zbgs = zbgs.Substring(0, zbgs.LastIndexOf("、"));
                    zbgs += "；";

                    string pms = "";

                    foreach (Maticsoft.Model.supplier_bidplan_order so in l)
                    {
                        pms += "<br /> &nbsp;&nbsp;&nbsp;&nbsp;" + "第" + so.s_order + "名：" + so.sname + "(得分：" + so.score + "分，报价：" + so.bj + "万元)";
                    }

                    Maticsoft.Model.supplier_bidplan_order s = l[0];

                    //预中标人这里默认为第一名
                    string yzbgs = "";

                    foreach (Maticsoft.Model.supplier_bidplan_order so in l)
                    {
                        if (so.s_order == 1)
                        {
                            yzbgs += "<br /> &nbsp;&nbsp;&nbsp;&nbsp;"+so.sname+" (投标报价："+so.bj+"万元) ";
                            break;
                        }
                       
                    }

                    this.lbl_title.Text = s.wtgs + "<br />" + s.projectname;
                    this.lbl_bh.Text = s.zbbh;
                    this.lbl_1.Text = s.zbgs + "受" + s.zbgs + "的委托,对其" + s.projectname + "采购项目进行邀请招标。截止开标时间，"
                        + s.bagnum + ":" + s.bagname + zbgs;
                    this.lbl_2_xm.Text = s.zbgs + s.projectname;
                    this.lbl_2_TimeAdd.Text = s.pbrq.Value + "时在" + s.wtgs;
                    this.lbl_3_projectname.Text = s.projectname;
                    this.lbl_4_yzbgs.Text = yzbgs;
                    //this.lbl_6_jdr.Text = s.jdr;
                    //this.lbl_6_pw.Text = s.pw;
                    this.lbl_rq.Text = s.pbrq.ToString();

                }
            }
        }
    }
}